/**
 * visKMedoids.h
 * Linux(ubuntu8.04),g++4.3.2
 * Copyright,2/3/2009,LU_CGCAD_THSS_THU_BEIJING
 * Author:Xinlai,Lu
 *
 * Modification history:
 * @1. I'm really sorry to comfirm you of that the memory to store the cluster centers have to be released by
 * 		 the application program itself, but not here in the class visKMedoids.
 * @2. Some variables and interfaces that are common to both visKMeans and visKMedoids are extracted and moved 
 *     to the class visStreamlineClustering.
 * @3. Extract part of the updateClusterCenters to the base class.
 * @4. 12/3/2009,by Xinlai,Lu,ubuntu,g++4.3.2
 *     For the sake of modification 4 at visStreamlineClustering.*, a parameter is set for the function 
 *     relocate() and updateClusterCenters().
 */

#include "visStreamlineClustering.h"

namespace visualization
{
class visKMedoids : public visStreamlineClustering
{
public:
	visKMedoids(Model *mdl) : visStreamlineClustering(mdl){}
	visKMedoids() {}
	void setDataField(Model *mdl)
	{ dataField(mdl); }

	~visKMedoids(){}

	/**
	 * @Modification 4 : A parameter added.
	 * @param itrtNum : the current iteration number. If there are k iterations then the range of the itrtNum
	 * is (0, 1, 2, ..., itrtNum-1), ie. the parameter starts from 0.
	 */
	void relocate(unsigned int itrtNum);

	/**
	 * The function calculate or update the cluster centers, and return information whether the 
	 * centers have changed.
	 * @return : the status whether it's needed to continue to cluster.
	 * @param itrtNum : the current iteration number. If there are k iterations then the range of the itrtNum
	 * is (0, 1, 2, ..., itrtNum-1), ie. the parameter starts from 0.
	 */
	_STATUS updateClusterCenters(unsigned int itrtNum);

private:
};// visKMedoids
}// visualization

